package hamsterwrench.gui;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTabbedPane;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import javax.swing.JLabel;
import com.jgoodies.forms.factories.FormFactory;
import java.awt.GridLayout;
import javax.swing.border.TitledBorder;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.JFormattedTextField;
import javax.swing.JSeparator;

public class GTSeditor extends JFrame {

	private JPanel contentPane;
	private JTextField txtAsorbsaDamage;
	private JTextField txtImmuneToe;
	private JTextField txtdDamageFrom;
	private JTextField txtdDamageFrom_1;
	private JTextField txtNoElementalEffects;
	private JTextField txtElementalEffects;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					GTSeditor frame = new GTSeditor();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public GTSeditor() {
		setResizable(false);
		setTitle("Global Text Strings");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 550, 660);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.LEFT);
		contentPane.add(tabbedPane, BorderLayout.CENTER);
		
		JPanel stats = new JPanel();
		tabbedPane.addTab("Stats", null, stats, null);
		stats.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		JLabel lblHealthPoints = new JLabel("Health Points:");
		lblHealthPoints.setToolTipText("");
		stats.add(lblHealthPoints, "2, 2");
		
		JLabel lblSpellPoints = new JLabel("Spell Points:");
		stats.add(lblSpellPoints, "2, 4");
		
		JLabel lblAttackPower = new JLabel("Attack Power:");
		stats.add(lblAttackPower, "2, 6");
		
		JLabel lblAccuracy = new JLabel("Accuracy:");
		stats.add(lblAccuracy, "2, 8");
		
		JLabel lblExtraHits = new JLabel("Extra Hits:");
		stats.add(lblExtraHits, "2, 10");
		
		JLabel lblBlockingPower = new JLabel("Blocking Power:");
		stats.add(lblBlockingPower, "2, 12");
		
		JLabel lblDodgeRate = new JLabel("Dodge Rate:");
		stats.add(lblDodgeRate, "2, 14");
		
		JLabel lblCounterRate = new JLabel("Counter Rate:");
		stats.add(lblCounterRate, "2, 16");
		
		JLabel lblSpeed = new JLabel("Speed:");
		stats.add(lblSpeed, "2, 18");
		
		JLabel lblSpellSkill = new JLabel("Spell Skill:");
		stats.add(lblSpellSkill, "2, 20");
		
		JLabel lblSpellBlock = new JLabel("Spell Block:");
		stats.add(lblSpellBlock, "2, 22");
		
		JLabel lblSpellEffeciency = new JLabel("Spell Effeciency %:");
		stats.add(lblSpellEffeciency, "2, 24");
		
		JPanel elements = new JPanel();
		tabbedPane.addTab("Elements", null, elements, null);
		elements.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel equipsl = new JPanel();
		tabbedPane.addTab("Equip Slots", null, equipsl, null);
		equipsl.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		JLabel lblWeapon = new JLabel("Weapon:");
		equipsl.add(lblWeapon, "2, 2");
		
		JLabel lblArmor = new JLabel("Armor 1:");
		equipsl.add(lblArmor, "2, 4");
		
		JLabel lblArmor_1 = new JLabel("Armor 2:");
		equipsl.add(lblArmor_1, "2, 6");
		
		JLabel lblArmor_2 = new JLabel("Armor 3:");
		equipsl.add(lblArmor_2, "2, 8");
		
		JLabel lblArmor_3 = new JLabel("Armor 4:");
		equipsl.add(lblArmor_3, "2, 10");
		
		JPanel spmenu = new JPanel();
		tabbedPane.addTab("Special Menus", null, spmenu, null);
		spmenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel itemmenu = new JPanel();
		tabbedPane.addTab("Item Menu", null, itemmenu, null);
		itemmenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel statscreen = new JPanel();
		tabbedPane.addTab("1st Status Screen", null, statscreen, null);
		statscreen.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel elementfx = new JPanel();
		tabbedPane.addTab("2nd Status Screen", null, elementfx, null);
		elementfx.setLayout(new BorderLayout(0, 0));
		
		JPanel info = new JPanel();
		info.setBorder(new TitledBorder(null, "Help", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		elementfx.add(info, BorderLayout.SOUTH);
		info.setLayout(new GridLayout(3, 2, 0, 0));
		
		JLabel lbleElementName = new JLabel("$E: Element Name");
		info.add(lbleElementName);
		
		JLabel lblNewLabel = new JLabel("$R: Reduction from normal dmg");
		info.add(lblNewLabel);
		
		JLabel lblz = new JLabel("$D: Percent of normal dmg");
		info.add(lblz);
		
		JLabel lblxPercentOf = new JLabel("$X: Percent of damage above 100");
		info.add(lblxPercentOf);
		
		JLabel lblNewLabel_1 = new JLabel("$A: Amount of dmg asorbed as heal");
		info.add(lblNewLabel_1);
		
		JPanel content = new JPanel();
		elementfx.add(content, BorderLayout.CENTER);
		content.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		JLabel lblElementalEffectsTitle = new JLabel("Elemental Effects Title:");
		lblElementalEffectsTitle.setHorizontalAlignment(SwingConstants.TRAILING);
		content.add(lblElementalEffectsTitle, "2, 2, right, default");
		
		txtElementalEffects = new JTextField();
		txtElementalEffects.setText("Elemental Effects:");
		content.add(txtElementalEffects, "4, 2, fill, default");
		txtElementalEffects.setColumns(10);
		
		JLabel lblNoElementalEffects = new JLabel("No Elemental Effects:");
		lblNoElementalEffects.setHorizontalAlignment(SwingConstants.TRAILING);
		content.add(lblNoElementalEffects, "2, 4, right, default");
		
		txtNoElementalEffects = new JTextField();
		txtNoElementalEffects.setText("No Elemental Effects");
		content.add(txtNoElementalEffects, "4, 4, fill, default");
		txtNoElementalEffects.setColumns(10);
		
		JSeparator separator = new JSeparator();
		content.add(separator, "1, 6, 4, 1");
		
		JLabel lblTakes = new JLabel("Takes > 100% elemental damage:");
		lblTakes.setHorizontalAlignment(SwingConstants.TRAILING);
		content.add(lblTakes, "2, 8, right, default");
		
		txtdDamageFrom_1 = new JTextField();
		txtdDamageFrom_1.setText("$D damage from $E");
		content.add(txtdDamageFrom_1, "4, 8, fill, default");
		txtdDamageFrom_1.setColumns(10);
		
		JLabel lblTakesElemental = new JLabel("Takes 0~100% elemental damage:");
		lblTakesElemental.setHorizontalAlignment(SwingConstants.TRAILING);
		content.add(lblTakesElemental, "2, 10, right, default");
		
		txtdDamageFrom = new JTextField();
		txtdDamageFrom.setText("$D damage from $E");
		content.add(txtdDamageFrom, "4, 10, fill, default");
		txtdDamageFrom.setColumns(10);
		
		JLabel lblTakesNoElemental = new JLabel("Takes no elemental damage:");
		lblTakesNoElemental.setHorizontalAlignment(SwingConstants.TRAILING);
		content.add(lblTakesNoElemental, "2, 12, right, default");
		
		txtImmuneToe = new JTextField();
		txtImmuneToe.setText("Immune to $E");
		content.add(txtImmuneToe, "4, 12, fill, default");
		txtImmuneToe.setColumns(10);
		
		JLabel lblTakes_1 = new JLabel("Takes < 0% elemental damage:");
		lblTakes_1.setHorizontalAlignment(SwingConstants.TRAILING);
		content.add(lblTakes_1, "2, 14, right, default");
		
		txtAsorbsaDamage = new JTextField();
		txtAsorbsaDamage.setText("Asorbs $A damage from $E");
		content.add(txtAsorbsaDamage, "4, 14, fill, default");
		txtAsorbsaDamage.setColumns(10);
		
		JPanel equipmenu = new JPanel();
		tabbedPane.addTab("Equip Menu", null, equipmenu, null);
		equipmenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel spellsmenu = new JPanel();
		tabbedPane.addTab("Spells Menu", null, spellsmenu, null);
		spellsmenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel teammenu = new JPanel();
		tabbedPane.addTab("Team/Order Menu", null, teammenu, null);
		teammenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel saveloadmenu = new JPanel();
		tabbedPane.addTab("Save/Load Menu", null, saveloadmenu, null);
		saveloadmenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel quitmenu = new JPanel();
		tabbedPane.addTab("Quit Prompt", null, quitmenu, null);
		quitmenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel shopmenu = new JPanel();
		tabbedPane.addTab("Shop Menu", null, shopmenu, null);
		shopmenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel buyhiremenu = new JPanel();
		tabbedPane.addTab("Buy/Hire Menu", null, buyhiremenu, null);
		buyhiremenu.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel panel = new JPanel();
		tabbedPane.addTab("Sell Menu", null, panel, null);
		panel.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel inns = new JPanel();
		tabbedPane.addTab("Inns", null, inns, null);
		inns.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel battles = new JPanel();
		tabbedPane.addTab("Battles", null, battles, null);
		battles.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
		
		JPanel other = new JPanel();
		tabbedPane.addTab("Other", null, other, null);
		other.setLayout(new FormLayout(new ColumnSpec[] {},
			new RowSpec[] {}));
	}

}
